﻿using Microsoft.AspNetCore.Mvc;

namespace APIDemo2.Controllers
{
    [ApiController]
    [Route("[controller]/[action]")]
    public class HomeController : ControllerBase
    {

        [HttpGet]
        public IEnumerable<object> Get()
        {
            return Enumerable.Range(1, 5).Select(index => new
            {
                Date = DateOnly.FromDateTime(DateTime.Now.AddDays(index)),
                Randomnum = Random.Shared.Next(-20, 55),
            })
            .ToArray();
        }
    }
}
